package com.snow.system.convert;

import com.snow.system.domain.SysOaEmail;
import com.snow.system.domain.SysOaEmailDTO;
import com.snow.system.domain.request.SendSysOaEmailReq;
import com.snow.system.domain.response.SysOaEmailPageResp;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author qimingjin
 * @date 2023-10-18 09:09
 * @Description:
 */
@Mapper
public interface SysOaEmailConvert {

    SysOaEmailConvert INSTANCE = Mappers.getMapper(SysOaEmailConvert.class);

    List<SysOaEmailPageResp> convert(List<SysOaEmail> sysOaEmails);

    SysOaEmailDTO convert(SysOaEmail sysOaEmail);

    @Mappings({
            @Mapping(source = "operatorType",target = "emailStatus",defaultValue = "0")
    })
    SysOaEmail convert(SendSysOaEmailReq sendSysOaEmailReq);

}
